<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
    String ctx = request.getContextPath();
    request.setAttribute("ctx", ctx);
%>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" href="${ctx}/css/index_work.css">
    <script src="${ctx}/bootstrap/jquery-1.9.1.min.js"></script>
    <script src="${ctx}/bootstrap/jquery.validate.min.js"></script>
    <script src="${ctx}/bootstrap/messages_zh.js"></script>
    <script src="${ctx}/bootstrap/validate(3).js"></script>
</head>
<body>
<form>
    手机号<input type="text"name="phone_num" class="mobile"><br>
   密码<input type="password"name="password"><br>
    <input type="button" onclick="dl()" value="登录"><br>
</form>
<script>
    function dl() {
         var v=  $("form").valid();
         if(v){
        $.post("${ctx}/login.do",$("form").serialize(),function (date) {
            if(date){
                location.href="${ctx}/list.do";
            }else {
                alert("失败")
            }
        })
         }
    }
</script>
</body>
</html>